package com.twu.biblioteca;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * User: kush jain
 * Date: 6/28/13
 * Time: 6:40 PM
 * To change this template use File | Settings | File Templates.
 */
public class Book implements Serializable{
    public static int bookcount;
    public static ArrayList booksList = new ArrayList();
    public static final long serialVersionUID = 11;
    private int bookid;
    private String title;
    private String author;
    public int getBookId()
    {
        return bookid;
    }
    Book()
    {
        title = "Unknown";
        author = "Anonymous";
    }

    public String getBookInfoinString()
    {
        String bookinfo = "";
        bookinfo = bookinfo + bookid + "\t" + title + " written by " + author;
        return bookinfo;
    }
    public void setTitle(String title)
    {
          this.title = title;
    }
    public boolean inTitle(String otherTitle)
    {
        return title.toLowerCase().contains(otherTitle.toLowerCase());
    }
    public void setAuthor(String author)
    {
          this.author = author;
    }
    Book(int bookid)
    {
        this.bookid = bookid;
        title = "Unknown";
        author = "Anonymous";

    }


}